package com.ruoyi.system.Controller;


import com.ruoyi.system.domain.CmAnonymousCome;
import com.ruoyi.system.domain.Vo.R;
import com.ruoyi.system.mapper.CmAnonymousComeMapper;
import com.ruoyi.system.service.ICmCourtInfoService;
import com.ruoyi.system.service.WxMethodService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class WxMethodController {

    @Autowired
    private WxMethodService wxMethodService;
    @Autowired
    private ICmCourtInfoService cmCourtInfoService;


    //公告请求
    @GetMapping("/Wx/notice")
    public R publicnotice(){
        return wxMethodService.selectNoticedesc();
    }

    //居民所居地址请求
    @PostMapping("/Wx/courtInfo")
    public R selectCourtInfo(String openid){
        return wxMethodService.selectBlockInfo(openid);
    }

    //外来访客登记
    @PostMapping("/Wx/AyMousComeSubmit")
    public R AyMousComeSubmit(CmAnonymousCome cmAnonymousCome){
        System.out.println(cmAnonymousCome);
        return wxMethodService.AyMousComeSubmit(cmAnonymousCome);
    }

    //访客记录查询
    @PostMapping("/Wx/AymousComeHistory")
    public R AyMousComeList(String openid){
        return wxMethodService.AymousComeHistory(openid);
    }

    //根据居民openid查询当前待审批的访客
    @PostMapping("/Wx/AnymousApproveHistory")
    public R AnymousApproveHistory(String openid){
        return wxMethodService.selectApproveHistoryList(openid);
    }

    //根据id来对访客申请进行审批
    @PostMapping("/Wx/AnymousApprove")
    public R AnymousApprove(Long id,Integer isAgree){
        return wxMethodService.AnymousApprove(id,isAgree);
    }



}
